<?php if (!defined('NOVA_RUN')) die('You can\'t access this file directly!'); ?><?php $this->load('header'); ?>
<?php if ($this->curCat != 0): ?><div>
	<b><a href="<?php echo make_admin_link('category', 'view', array(($this->curCat['parent_id'] > 0) ? $this->curCat['parent_id'] : null)); ?>">BACK</a></b>
	<b><a href="<?php echo make_admin_link('category', 'edit', array(Router::param(0))); ?>">EDIT</a></b>
	<b><a href="<?php echo make_admin_link('category', 'remove', array(Router::param(0))); ?>">REMOVE</a></b>
	<b><a href="<?php echo make_admin_link('category', 'permissions', array(Router::param(0))); ?>">PERMISSIONS</a></b>
</div><?php endif; ?>
<div><b><a href="<?php echo make_admin_link('category', 'add', (Router::param(0) > 0) ? array(Router::param(0)) : array()); ?>">ADD</a></b></div>
<?php if (!$this->error): ?>
	<?php for ($i=0; $i < sizeof($this->categories); ++$i): ?>
		<div style="margin-top:10px; margin-bottom:10px;">
			<b><a href="<?php echo make_admin_link('category', 'view', array($this->categories[$i]['id'])); ?>"><?php echo $this->categories[$i]['name']; ?></a></b>
			<br />
			<i><?php echo $this->categories[$i]['description']; ?></i>
			<br />
			<a href="#">Add</a> <a href="#">Edit</a> <a href="#">Remove</a> <a href="<?php echo make_admin_link('category', 'permissions', array($this->categories[$i]['id'])); ?>">Permissions</a>
		</div>
	<?php endfor; ?>
<?php endif; ?>
<?php $this->load('footer'); ?>